package com.hava.demo.springmvc.onlyone.controller.websocket;

import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by zhanpeng on 15-6-5.
 */
@Controller
//@RequestMapping(value = "/api/demo/websocket/v1/onlyone")
public class OnlyOneWebSocketController {


    @RequestMapping(value="/websocket/demo/onlyone", method = RequestMethod.POST)
    public void post(String Message) {
        System.out.print("Class " + this.getClass().getName() + " Method post Debug:[Message]:" + Message);
    }
    
    @MessageMapping("/websocket/demo/onlyone")
    public String handle(String Message) {
        System.out.print("Class " + this.getClass().getName() + " Method handle Debug:[Message]:" + Message);

        return Message;
    }
}